//
//  DSystemColorTool.m
//  DFrame
//
//  Created by DaiSuke on 2016/12/23.
//  Copyright © 2016年 DaiSuke. All rights reserved.
//

#import "DSystemColorTool.h"

@implementation DSystemColorTool
SYNTHESIZE_SINGLETON_FOR_CLASS(DSystemColorTool)

- (id)init{
    if(self = [super init]){
        [self setDefaultColor];
    }
    return self;
}



- (void)reFreshAllColorByAppBgType:(DAppBgType)bgType{
    switch (bgType) {
        case DAppBgTypeDefault:{
            [self setDefaultColor];
        }
            break;
        case DAppBgTypeNight:{
            _navBgColor = DUIColorFromRGB16(0x132249);
            _appBgColor = DUIColorFromRGB16(0x0c1c34);
            _whiteColor = DUIColorFromRGB16(0x0e2341);
            _lineColor = DUIColorFromRGB16(0x051121);
            _titleColor = DUIColorFromRGB16(0x6b82a6);
            _textColor = DUIColorFromRGB16(0x344e74);
            _contentColor = DUIColorFromRGB16(0x344e74);
            _messageTopColor = DUIColorFromRGB16(0x0c1f35);
            _cellSelectColor = DUIColorFromRGB16(0x0c1f35);
            _searchBarBgColor = DUIColorFromRGB16(0x0c1c34);
            _chatListBgColor = DUIColorFromRGB16(0x0e2341);
            _loadingBgColor = DUIColorFromRGB16(0x0e2341);
            _tabbarSelectImageColor = [UIColor redColor];
        }
            break;
        default:
            break;
    }
    
}

- (void)setDefaultColor{
    _navBgColor = DUIColorFromRGB16(0xff5500);
    _appBgColor = DUIColorFromRGB16(0xf7f7f7);
    _whiteColor = [UIColor whiteColor];
    _lineColor = DUIColorFromRGB16(0xe0e0e0);
    _titleColor = DUIColorFromRGB16(0x333333);
    _textColor = DUIColorFromRGB16(0x666666);
    _contentColor = DUIColorFromRGB16(0x999999);
    _messageTopColor = DUIColorFromRGB16(0xf3f3f6);
    _cellSelectColor = DUIColorFromRGB16(0xd9d9d9);
    _searchBarBgColor = DUIColorFromRGB16(0xdddddd);
    _chatListBgColor = DUIColorFromRGB16(0xf7f7f7);
    _loadingBgColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7];
    _tabbarSelectImageColor = DUIColorFromRGB16(0xff5500);
}

- (UIColor *)getDefaultColorByType:(DAppBgType)bgType currentColor:(UIColor *)currentColor{
    if(bgType == DAppBgTypeNight){
        currentColor = DUIColorFromRGB16(0x0c1d37);
    }
    return currentColor;
}

@end
